package com.ivan.demo.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @Author Ivan
 * @Description easyExcel监听器
 * @Date 2020/8/8 14:04
 */
public class ExcelListener extends AnalysisEventListener<DemoData> {
    /**
     * @Author Ivan
     * @Description 一行一行读取excel内容
     * @Date 2020/8/8 14:05
     * @Param 
     * @return 
     */
    @Override
    public void invoke(DemoData data, AnalysisContext analysisContext) {
        System.out.println("****" + data);
    }

    /**
     * @Author Ivan
     * @Description 读取表头内容
     * @Date 2020/8/8 14:05
     * @Param 
     * @return 
     */
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头：" + headMap);
    }

    /**
     * @Author Ivan
     * @Description 读取完成之后
     * @Date 2020/8/8 14:15
     * @Param 
     * @return 
     */
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
    }
}
